from rest_framework.pagination import PageNumberPagination

class CustomPageNumberPagination(PageNumberPagination):
    page_size = 10
    page_query_param = 'pageNum'  # 自定义的分页查询参数
    page_size_query_param = 'pageSize'

    def get_page_number(self, request, view):
        return int(request.query_params.get(self.page_query_param, 1))

    def get_page_size(self, request):
        return int(request.query_params.get(self.page_size_query_param, self.page_size))